_Get Random Item from WMU
(23 actions, 31 KB)
0 Dictionary
γβ mappingDict
γΒ»
16
20
{ "Wisdom I Pondered This Week": { "lineOffset": 13, "title": "π Life Wisdom" }, "Things I Learned This Week": { "lineOffset": 21, "title": "π¨π½βπ Lifelong Learner" } }
1 File
γβ Weekly-Mindware-Update
γΒ»
File
:
{ "fileLocation": { "WFFileLocationType": "iCloud", "fileProviderDomainID": "com.apple.CloudDocs.iCloudDriveFileProvider/8CD4A3FB-3479-45CB-829A-CE2FA3119626", "relativeSubpath": "iCloud~md~obsidian/Documents/Second-Brain/Weekly-Mindware-Update", "appContainerBundleIdentifier": "md.obsidian", "crossDeviceItemID": "docs.icloud.com:com.apple.CloudDocs/3438C552-7900-4D1C-BDC5-E1CF43886E3B/29d958dbcf2f63cc9e41b5db4fd1bc1dde45d4ec" }, "filename": "Weekly-Mindware-Update", "displayName": "Weekly-Mindware-Update" }
2 Get Contents of FolderγΒ»
Folder
:
[1 Weekly-Mindware-Update]
Recursive
:
true
3 Filter Files
[2 Get Contents of Folder]
γΒ»
ContentItemFilter
:
β’ All the following are true Name is not README File Extension is md
4 Run Shortcut
_Get Random Item From List
γβ randomWMUFile
γΒ»
5
7
Input
:
[3 Files]
Workflow
:
{ "workflowIdentifier": "E625C6C1-A183-473F-82BB-06827A38FB78", "workflowName": "_Get Random Item From List", "isSelf": false }
5 Match Text
Weekly-Mindware-Update/(.*)
in
[4 randomWMUFile
βs File Path
]
γΒ»
MatchTextCaseSensitive
:
true
6 Get Match Group At Index 1 in
[5 Matches]
γΒ»
21
7 Split Text
[4 randomWMUFile]
by New LinesγΒ»
8 Filter Files
[7 Split Text]
γΒ»
10
12
ContentItemLimitEnabled
:
false
ContentItemFilter
:
Name begins with *
9 If
[Shortcut Input
βs Name
]
is
Wisdom I Pondered This Week
10 Get
Items in Range
1
to
5
from List
[8 Files]
γβ content
γΒ»
14
11 Otherwise
12 Get
Items in Range
6
to
10
from List
[8 Files]
γβ content
13 End IfγΒ»
15
14 Run Shortcut
_Get Random Index From List
γβ randomIdx
γΒ»
15
17
Input
:
[10 content]
Workflow
:
{ "workflowIdentifier": "68A63D4D-7450-49C4-962F-B7F608B749A8", "workflowName": "_Get Random Index From List", "isSelf": false }
15 Get
Item At Index
[14 randomIdx]
from List
[13 If Result]
γβ randomItem
γΒ»
18
16 Get Dictionary Value for
[Shortcut Input]
.lineOffset
in
[0 mappingDict]
γβ lineOffset
γΒ»
17 Calculate Expression
[16 lineOffset]
+
[14 randomIdx]
- 1
γΒ»
21
18 Run Shortcut
Get Plain Text from Markdown
γΒ»
Input
:
[15 randomItem]
Workflow
:
{ "workflowIdentifier": "DAB244B1-0299-4B66-A0F1-726F17ED5A84", "workflowName": "Get Plain Text from Markdown", "isSelf": false }
19 Run Shortcut
Strip Leading Symbol
γΒ»
21
Input
:
[18 Shortcut Result]
Workflow
:
{ "workflowIdentifier": "8FC46502-BE99-4573-AE81-F7EBE87C0935", "workflowName": "Strip Leading Symbol", "isSelf": false }
20 Get Dictionary Value for
[Shortcut Input]
.title
in
[0 mappingDict]
γβ title
γΒ»
21 DictionaryγΒ»
{ "filepath": "
[6 Text]
", "item": "
[19 Shortcut Result]
", "line":
[17 Calculation Result]
as Number
, "title": "
[20 title]
" }
22 Stop and Output
[21 Dictionary]